package org.example.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.example.domain.Food;

import java.util.List;

public interface FoodDao {
    @Insert("insert into tb_food values(null,#{name},#{description},#{type})")
    public void save(Food food);
    @Update("update tb_food set name=#{name},description=#{description},type=#{type} where id=#{id}")
    public void update(Food food);
    @Delete("delete from tb_food where id=#{id}")
    public void delete(Integer id);
    @Select("select * from tb_food where id=#{id}")
    public Food findById(Integer id);
    @Select("select * from tb_food")
    public List<Food> findAll();

}
